Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1675 +/- ##
============================================
+ Coverage 99.53% 99.56% +0.02%
- Complexity 929 970 +41
============================================
Files 190 193 +3
Lines 2170 2280 +110
============================================
+ Hits 2160 2270 +110
Misses 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ce76143 to
dc6b877
Compare
There was a problem hiding this comment.
Pull request overview
Adds a Template::from($class, $mode) static façade to make validator template lookup easier (supporting translation/migration scenarios), and updates translation/configuration documentation and examples accordingly.
Changes:
- Introduce
Respect\Validation\Message\Template::from()for resolving a validator’sTemplateattribute by template id. - Update translator feature test and translation docs to reference templates via
Template::from(...)instead of hardcoded strings. - Extract duplicated container notes into a new
docs/configuration.mdand update docs to link to it.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Message/Template.php |
Adds Template::from() for reflective lookup of template attributes by id. |
tests/unit/TemplateTest.php |
New unit tests validating Template::from() behavior and error cases. |
tests/feature/TranslatorTest.php |
Updates translation resources to key off Template::from(...)->default and adds more template-based entries. |
docs/migrating-from-v2-to-v3.md |
Adds a migration note pointing readers to the updated translation docs. |
docs/messages/translation.md |
Reworks translation guide and includes Template::from(...)-based examples; links to configuration docs. |
docs/messages/placeholder-conversion.md |
Replaces duplicated container notes with a link to docs/configuration.md. |
docs/configuration.md |
New centralized container configuration documentation. |
docs/case-sensitiveness.md |
Updates example wording to reference v::after wrappers. |
Comments suppressed due to low confidence (1)
tests/feature/TranslatorTest.php:44
- The translation resources are clearly Portuguese, but they’re registered under locale "en". This makes the example/test confusing and differs from the docs (which use pt_BR). Consider setting the Translator locale and the addResource locale to "pt_BR" to match the actual translations.
'and' => 'e',
],
'en',
);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f6d8d9 to
a87b034
Compare
a87b034 to
fe0e029
Compare
fe0e029 to
673381d
Compare
673381d to
9176d3d
Compare
The documents on translation were updated to feature symfony with an array provider. Duplicated container notes were extracted to a single configuration.md file. An API for accessing the messages, so users don't have to copy and paste them from the source or docs, was provided and TemplateResolver was refactored to use it.
9176d3d to
0240807
Compare
henriquemoody
left a comment
There was a problem hiding this comment.
If you want to recreated Template::from(), by all means! The PR is good for merge anyways.
The documents on translation were updated to feature symfony with
an array provider. Duplicated container notes were extracted to
a single configuration.md file.
An API for accessing the messages, so users don't have to copy
and paste them from the source or docs, was provided and
TemplateResolver was refactored to use it.